<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var Vue=function(options){
            this._init(options);
        }
        Vue.prototype._init=function(options){
            this.data=options.data;
        }

        var obj1={
            data:{
                msg:"测试数据"
            }
        }
        //此时传的是地址，v1改变数据v2也会改变
        var v1=new Vue(obj1);
        var v2=new Vue(obj1);

        var obj2={
            data:function(){
                return {
                    msg:"测试数据"
                };
            }
        }
        //data为返回的一个字面量对象，每次返回的地址都不相同，所以v1和v2的数据不会产生关联
        var v3 = new Vue(obj2);
        var v4 = new Vue(obj2);

        
    </script>
</body>
</html>